/*
 action type 定义类
 createRequestTypes 函数产生如下的API 调用 ActionType,
 {
 "REQUEST": "USER_LOGIN_REQUEST",
 "SUCCESS": "USER_LOGIN_SUCCESS",
 "FAILURE": "USER_LOGIN_FAILURE"
 }
 */

const REQUEST = 'REQUEST'
const SUCCESS = 'SUCCESS'
const FAILURE = 'FAILURE'

function createRequestTypes(base) {
  return [REQUEST, SUCCESS, FAILURE].reduce((acc, type) => {
    acc[type] = `${base}_${type}`
    return acc
  }, {})
}

// 用户登录
export const USER_LOGIN = createRequestTypes('USER_LOGIN')

//检查token
export const CHECK_TOKEN = createRequestTypes('CHECK_TOKEN')

// 用户登出
export const USER_LOGOUT = createRequestTypes('USER_LOGOUT')

// 获取用户菜单
export const USER_MENU = createRequestTypes('USER_MENU')

// 获取学生个人信息
export const STUDENT_PROFILE = createRequestTypes('STUDENT_PROFILE')

// 学生个人信息更新，单纯view的更新
export const PROFILE_UPDATE = 'PROFILE_UPDATE';

//公司信息更新，单纯view的更新
export const COMPANY_UPDATE = 'COMPANY_UPDATE';

// 公司信息查询
export const COMPANY_QUERY = createRequestTypes('COMPANY_QUERY')

// 提交申请
export const ORDER_APPLY = createRequestTypes('ORDER_APPLY')

// 提交申请
export const ORDER_APPLY_FINISH = 'ORDER_APPLY_FINISH'

// 待审批申请查询，列表
export const ORDERS_QUERY = createRequestTypes('ORDERS_QUERY')

// 审批查询，单个
export const ORDER_QUERY = createRequestTypes('ORDER_QUERY')

//审批历史查询
export const TIMELINE_QUERY = createRequestTypes('TIMELINE_QUERY')

//发起审批
export const ORDER_CHECK = createRequestTypes('ORDER_CHECK')

//发起upload状态列表查询
export const UPLOAD_LIST_QUERY = createRequestTypes('UPLOAD_LIST_QUERY')

//导入详情数据请求
export const UPLOAD_DETAIL_QUERY = createRequestTypes('UPLOAD_DETAIL_QUERY')

//学生数据查询
export const STUDENTS_QUERY = createRequestTypes('STUDENTS_QUERY')

//删除学生数据
export const STUDENTS_DELETE = createRequestTypes('STUDENTS_DELETE')
//删除完数据以后通知
export const STUDENTS_DELETE_NOTIFY = 'STUDENTS_DELETE_NOTIFY'

//checkoneunmount
export const CHECK_ONE_UNMOUNT = 'CHECK_ONE_UNMOUNT'
export const COMPANY_NOTIFY_CLEAR = 'COMPANY_NOTIFY_CLEAR'



//用人单位信息查询
export const COMPANYS_QUERY = createRequestTypes('COMPANYS_QUERY')

//用人单位信息删除
export const COMPANYS_DELETE = createRequestTypes('COMPANYS_DELETE')

export const COMPANYS_DELETE_NOTIFY = 'COMPANYS_DELETE_NOTIFY'
export const ENTERPRISE_CREATE_CLEAR = 'ENTERPRISE_CREATE_CLEAR'
export const NOTIFICATION_UNREAD_QUERY = createRequestTypes('NOTIFICATION_UNREAD_QUERY');

//发送通知action
export const COMPANY_NOTIFY = createRequestTypes('COMPANY_NOTIFY')

//用单人位信息录入action
export const ENTERPRISE_CREATE = createRequestTypes('ENTERPRISE_CREATE')

//查询新到通知
export const NOTIFICATION_NEW_QUERY = createRequestTypes('NOTIFICATION_NEW_QUERY')

//标记为已读
export const NOTIFICATION_MARK_READED = createRequestTypes('NOTIFICATION_MARK_READED')



